home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / swappi1a / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-17  |  4.0 KB  |  136 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Command State Change Demo"
  5.    ClientHeight    =   6795
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   8100
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   6795
  11.    ScaleWidth      =   8100
  12.    StartUpPosition =   2  'CenterScreen
  13.    Begin SHDocVwCtl.WebBrowser webBrowser 
  14.       Height          =   4935
  15.       Left            =   120
  16.       TabIndex        =   2
  17.       Top             =   1800
  18.       Width           =   7935
  19.       ExtentX         =   13996
  20.       ExtentY         =   8705
  21.       ViewMode        =   0
  22.       Offline         =   0
  23.       Silent          =   0
  24.       RegisterAsBrowser=   0
  25.       RegisterAsDropTarget=   1
  26.       AutoArrange     =   0   'False
  27.       NoClientEdge    =   0   'False
  28.       AlignLeft       =   0   'False
  29.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  30.       Location        =   ""
  31.    End
  32.    Begin VB.TextBox txtURL 
  33.       Height          =   405
  34.       Left            =   840
  35.       TabIndex        =   0
  36.       Top             =   1080
  37.       Width           =   6255
  38.    End
  39.    Begin VB.Image imgGo 
  40.       Height          =   420
  41.       Left            =   7200
  42.       Picture         =   "Form1.frx":0000
  43.       Top             =   1080
  44.       Width           =   720
  45.    End
  46.    Begin VB.Label Label1 
  47.       Alignment       =   2  'Center
  48.       Caption         =   "URL:"
  49.       BeginProperty Font 
  50.          Name            =   "MS Sans Serif"
  51.          Size            =   8.25
  52.          Charset         =   0
  53.          Weight          =   700
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   255
  59.       Left            =   240
  60.       TabIndex        =   1
  61.       Top             =   1200
  62.       Width           =   495
  63.    End
  64.    Begin VB.Image imgForwardDis 
  65.       Height          =   750
  66.       Left            =   960
  67.       Picture         =   "Form1.frx":02D2
  68.       ToolTipText     =   "Forward - Disabled"
  69.       Top             =   120
  70.       Width           =   750
  71.    End
  72.    Begin VB.Image imgForward 
  73.       Height          =   750
  74.       Left            =   960
  75.       Picture         =   "Form1.frx":066A
  76.       ToolTipText     =   "Forward"
  77.       Top             =   120
  78.       Width           =   750
  79.    End
  80.    Begin VB.Image imgBackDis 
  81.       Height          =   750
  82.       Left            =   120
  83.       Picture         =   "Form1.frx":0B0D
  84.       ToolTipText     =   "Back - Disabled"
  85.       Top             =   120
  86.       Width           =   750
  87.    End
  88.    Begin VB.Image imgBack 
  89.       Height          =   750
  90.       Left            =   120
  91.       Picture         =   "Form1.frx":0EA5
  92.       ToolTipText     =   "Back"
  93.       Top             =   120
  94.       Width           =   750
  95.    End
  96. Attribute VB_Name = "Form1"
  97. Attribute VB_GlobalNameSpace = False
  98. Attribute VB_Creatable = False
  99. Attribute VB_PredeclaredId = True
  100. Attribute VB_Exposed = False
  101. Option Explicit
  102. Private Sub imgBack_Click()
  103.   webBrowser.GoBack
  104. End Sub
  105. Private Sub imgForward_Click()
  106.   webBrowser.GoForward
  107. End Sub
  108. Private Sub imgGo_Click()
  109.   webBrowser.Navigate txtURL.Text
  110. End Sub
  111. Private Sub txtURL_KeyPress(KeyAscii As Integer)
  112.   If KeyAscii = 13 Then
  113.     webBrowser.Navigate txtURL.Text
  114.   End If
  115. End Sub
  116. Private Sub webBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
  117.   If Command = 1 Then 'For the forward button
  118.     If Enable = True Then
  119.       imgForward.Visible = True
  120.       imgForwardDis.Visible = False
  121.     Else
  122.       imgForward.Visible = False
  123.       imgForwardDis.Visible = True
  124.     End If
  125.   End If
  126.   If Command = 2 Then 'For the back button
  127.     If Enable = True Then
  128.       imgBack.Visible = True
  129.       imgBackDis.Visible = False
  130.     Else
  131.       imgBack.Visible = False
  132.       imgBackDis.Visible = True
  133.     End If
  134.   End If
  135. End Sub
  136.